import {NgModule} from '@angular/core';
import {Routes, RouterModule} from "@angular/router";
import {AuthGuardService} from "@shared/service/auth-guard/auth-guard.service";
import {OrderComponent} from "@order/order.component";
import {ConfirmOrderComponent} from "@order/confirm-order/confirm-order.component";
import {OrderListComponent} from "@order/order-list/order-list.component";
import {OrderDetailComponent} from "@order/order-detail/order-detail.component";

const routes: Routes = [
  {
    path: '',
    component: OrderComponent,
    canActivateChild: [AuthGuardService],
    children: [
      {
        path: 'detail/:orderId',
        component: OrderDetailComponent
      },
      {
        path: 'confirm-order',
        component: ConfirmOrderComponent
      },
      {
        path: ':tabCode',
        component: OrderListComponent
      },

    ]
  },
];

@NgModule({
  imports: [
    RouterModule.forChild(routes)
  ],
  exports: [RouterModule]
})
export class OrderRoutingModule {
}
